<?php

class DB_ANALYSIS_CONFIG extends ORM_Table {
    
    static $users   = array();
    static protected $table_name = 'analysis_config';
    
    static public function getTableName($params = null) {
        return self::$table_name;
    }

    /**
     *
     * @param type $weibo_id
     * @param type $key
     * @param type $value
     * @return DB_ANALYSIS_CONFIG 
     */
    static public function store($weibo_id,$key,$value){
        $rs = ORM_Finder::findOne('DB_ANALYSIS_CONFIG', array('weibo_id'=>$weibo_id,'p_key'=>$key));
        if(!$rs){
            $rs = new DB_ANALYSIS_CONFIG();
            $rs->setPKey($key);
            $rs->setPValue($value);
            $rs->setWeiboId($weibo_id);
            $rs->save();
        }
        return $rs;
    }
}

?>
